---
title: Run attorney assignment batch process
summary: Executes the attorney-assignment batch algorithm inside a transaction and surfaces its results.
status: draft
owner: SAIF Documentation Pipeline
last_reviewed: 2026-08-21
library: SAIF.Application.Claim.Legal
reference_type: embedded
operation_id: OP-LGL-005
trigger: clsAssignmentManager.RunAssignmentProcess() invoked
---

# Run attorney assignment batch process

This operation constructs and runs the attorney-assignment batch process inside an explicit transaction, then surfaces the resulting assignment list/detail for display.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-LGL-005 |
| **Trigger** | `clsAssignmentManager.RunAssignmentProcess()` invoked (batch UI/job) |
| **Inputs** | Current application environment (Production or not) |
| **Outputs** | `AssignmentList` / `AssignmentDetail` |
| **Primary components** | `clsAssignmentManager.RunAssignmentProcess` |
| **Entry point** | `SAIF.Application.Claim.Legal\LegalNet\clsAssignmentManager.vb` |

## Steps

1. Instantiate `clsAssignmentProcess(DPI, Testing)`.
   - `Testing` is set to `True` when the current environment is not Production ([BR-LGL-006](../business-rules.md#br-lgl-006-attorney-assignment-batch-process-runs-in-testing-mode-outside-production)).
2. Wrap execution in an explicit transaction (`OnTransactionStart` / `OnTransactionStop`).
3. Call `clsAssignmentProcess.RunAssignmentProcess`.

   > **Origin**: delegates to `SAIF.Business.Claim.Legal` (see [operations and processes](../../saif-business-claim-legal/operations-processes.md)) — the internal step sequence of `clsAssignmentProcess.RunAssignmentProcess` was not traced in this run's Stage 1 analysis (would require a RAG/Legends lookup against `SAIF.Business.Claim.Legal` documentation); this callout is inferred/best-effort.*
   - On failure: catch the exception, ensure the transaction is stopped, then rethrow.
4. On success: pull `AssignmentList`/`AssignmentDetail` from the process object for display.

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start([RunAssignmentProcess invoked]) --> Instantiate[Instantiate clsAssignmentProcess<br>Testing flag by environment]
	Instantiate --> TxStart[OnTransactionStart]
	TxStart --> Run[clsAssignmentProcess.RunAssignmentProcess]
	Run --> Success{Succeeded?}
	Success -->|Yes| TxStop[OnTransactionStop]
	Success -->|No| TxStopErr[OnTransactionStop] --> Rethrow([Rethrow exception])
	TxStop --> Results[Read AssignmentList/AssignmentDetail]
	Results --> EndOk([Display results])
```

## Failure and edge-case behavior

- Any exception from `clsAssignmentProcess.RunAssignmentProcess`: the transaction is stopped before the exception is rethrown to the caller — the batch process does not leave an open transaction on failure.
- Non-Production environments: the process runs in `Testing` mode, altering its (business-layer) behavior*.

> **Note:** Statements marked with `*` were inferred from code structure, naming
> conventions, or contextual evidence where direct confirmation was not available
> in source artifacts.

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [SQL catalog](../sql/index.md)
- [Database tables](../database-tables.md)

## Sources
- `SAIF.Application.Claim.Legal\LegalNet\clsAssignmentManager.vb`
